//
//  CurrencyIcon.swift
//  LOTR Converter
//
//  Created by li on 2025/4/2.
//
import SwiftUI

struct CurrencyIcon: View {
    let text:String
    let icon:ImageResource
    var body : some View{
        
        ZStack(alignment:.bottom){
            Image(icon)
                .resizable()
                .scaledToFit()
            Text(text)
                .padding(3)
                .font(.caption)
                .frame(maxWidth: .infinity)
                .background(.brown.opacity(0.7))
        }.padding(3)
            .frame(width: 100,height: 100)
            .background(.brown)
            .clipShape(.rect(cornerRadius: 25))
    }

}

#Preview{
    CurrencyIcon(text: "金币", icon: .goldpenny)
}
